package top.dprkshow.springboothelloworld.api;

import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.dprkshow.springboothelloworld.exception.MyException;
import top.dprkshow.springboothelloworld.utils.UUIDUtil;

/**
 * @author Kent HAN
 * @date 2021/7/6
 */
@RestController
public class ThrowException {
    @GetMapping("/exception")
    public String throwExcpetion() throws MissingServletRequestParameterException {
        throw new MissingServletRequestParameterException("name","String");
    }
    @GetMapping("myexception")
    public String testMyException() throws MyException {
        throw new MyException("i am a myException");
    }
}
